package com.ushine.design.design.c_behavioral_pattern.a_chain_of_responsibility.b_example;

/**
 * 具体处理者 ：主任类
 *
 * @author yls
 */
public class Director extends Approver {

    public Director(String name) {
        super(name);
    }

    @Override
    public void processRequest(PurchaseRequest request) {
        if (request.getAmount() < 50000) {
            System.out.println("主任：" + this.name + "审批采购单：" + request.getNumber() +
                    ",金额：" + request.getAmount() + "元，采购目的：" + request.getPurpose() + "。");
        } else {
            this.successor.processRequest(request);
        }
    }

}
